<div style="padding:15px;">
<%= link_to 'Back to '+ @repair_record.repair_state.name, :controller => 'repair_records', :list_name => @repair_record.repair_state.short_name %>
<%= link_to 'Print Auth', {:action => "authorization_pdf", :id => @repair_record.id} %>
<%= link_to 'Print Conf', {:action => "confirmation_pdf", :id => @repair_record.id} %>
<h1>Repair Record <%= @repair_record.id.to_s %></h1>
<div>
	<b><%= link_to @repair_record.customer_record.fname + " " + @repair_record.customer_record.lname, {:controller => "customer_records", :action => "edit", :id => @repair_record.customer_record.id } %></b>
	<br />
      <%- if @repair_record.customer_record.mobile -%>
		<%= content_tag :span , "Cell: " + number_to_phone(@repair_record.customer_record.mobile, :delimiter => ".")   %>
	<%- end -%><br />
      <%- if @repair_record.customer_record.work -%>
		<%= content_tag :span , "Work: " + number_to_phone(@repair_record.customer_record.work, :delimiter => ".") %>
	<%- end -%><br />
</div>
	
	<br />
	<% for note in @triage_notes %>
		<div style="width:700px;min-height:40px;border:thin solid gray;margin-bottom:3px;">
			<div style="width:700px;border-bottom:thin dotted gray;font-size:9px;color:gray;">posted by <%= sanitize note.user.login %> at <%= note.created_at.strftime("%b %d %Y %I:%M%p") %></div>
		<div style="margin:2px;"><%=  sanitize note.note %></div>
		
			<div style="width:700px;border-top:thin dotted gray;font-size:9px;color:gray;">Status set at <b><%= note.repair_state.name %></b>. 
				<% if note.assigned_to %>Assigned to <b><%= note.assigned_to.login  %></b><% else %><%= content_tag :b, "Not assigned" %><%end%>
			</div>
		</div>
	<% end %>
	
	<% form_tag :action => 'create_triage_note', :id => @repair_record.id do %>
	<div style="width:700px;min-height:40px;border:thin solid black;">
			
		    <%= content_tag :span, (text_area :triage_note, :note, {:size=>"70x6"})  %>
		 	<%= content_tag :span, "Status"%><%= select( :triage_note, "repair_state_id", @repair_states.collect {|c| [ c.name, c.id ] },{ :selected => @repair_record.repair_state_id.to_i }) %>
			<%= content_tag :span, "Assigned to"%><%= select( :triage_note, "assigned_to_id", @users.collect {|c| [ c.login, c.id ] },{ :selected => @repair_record.assigned_to_id.to_i ,:include_blank => true }) %>
			<%= submit_tag "Save" %>
	</div>
<% end %>
<%= link_to 'Back to '+ @repair_record.repair_state.name, :controller => 'repair_records', :list_name => @repair_record.repair_state.short_name %>
<%= link_to 'Print Auth', {:action => "authorization_pdf", :id => @repair_record.id} %>
<%= link_to 'Print Conf', {:action => "confirmation_pdf", :id => @repair_record.id} %>
</div>
